package model

import (
	"openapi.itspire.cn/database"
)

type User struct {
	Id   	 	uint64 `json:"id"`
	Nickname 	string `json:"nickname" binding:"required"`
	Avatar      string `json:"avatar"`
	ContactType uint8  `json:"contactType"`
	Contact     string `json:"contact"`
	Status      uint8  `json:"status"`
	CreateTime  uint64 `json:"createTime"`
	UpdateTime  uint64 `json:"updateTime"`
	DeleteTime  uint64 `json:"-"`
}

type Login struct {
	Nickname 	string `json:"nickname" binding:"required"`
	Contact     string `json:"contact"  binding:"required"`
	Avatar      string `json:"avatar"`
	ContactType uint8  `json:"contactType" binding:"required"`
}

func (user User) GetTableName() string {
	return database.Ins.NewScope(user).TableName()
}